package com.zpark.drug.pojo;

import com.zpark.drug.common.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 员工信息
 */

@Table(name = "employee")
public class Employee {
    @Id
    @Column(name = "employee_id")
    private Integer id;

    @Column(name = "employee_name")
    private String name;
    @Column(name = "employee_sex")
    private String sex;
    @Column(name = "employee_birthday")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    @Column(name = "employee_address")
    private String address;
    @Column(name = "employee_contact")
    private String contact;
    @Column(name = "employee_entry")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date entry;
    public String getBirthdayStr(){
        return DateUtil.dateConvert(birthday);
    }
    public String getEntryStr(){
        return DateUtil.dateConvert(entry);
    }

    public Integer getId() {

        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public Date getEntry() {
        return entry;
    }

    public void setEntry(Date entry) {
        this.entry = entry;
    }
}
